﻿<Window x:Class="DemoDataBinding.CmbSelectedValue"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:DemoDataBinding"
        Title="CmbSelectedValue" Height="130" Width="300">
    <Window.Resources>
        <local:CmbSelectedValueViewModel x:Key="vm"/>
    </Window.Resources>
    <Grid DataContext="{StaticResource vm}">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <ComboBox Margin="5" ItemsSource="{Binding Path=States}" 
                  DisplayMemberPath="Key"
                  SelectedValuePath="Value"
                  SelectedValue="{Binding Path=CurrentAbbreviation}"
                  HorizontalContentAlignment="Center"
                  VerticalContentAlignment="Center"/>
        <Label Grid.Row="1" 
               Margin="5" Content="{Binding Path=CurrentAbbreviation}"
               HorizontalContentAlignment="Center"
               VerticalContentAlignment="Center"
               Foreground="Crimson"
               Background="LightGray"
               FontWeight="ExtraBold"
               FontSize="24"/>

    </Grid>
</Window>
